

$(document).ready(function () {
        $('#fbrq').val(getNowFormatDate());
});
function getNowFormatDate() {//获取当前时间
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1<10? "0"+(date.getMonth() + 1):date.getMonth() + 1;
    var strDate = date.getDate()<10? "0" + date.getDate():date.getDate();
    var currentdate = date.getFullYear() + seperator1  + month  + seperator1  + strDate
        + " "  + date.getHours()  + seperator2  + date.getMinutes()
        + seperator2 + date.getSeconds();
    return currentdate;
}


function cancel(){
    parent.layer.closeAll();
}
function publish (){
    var bbh=$("#bbh").val();
    var fbrq=$("#fbrq").val();
    $.ajax({
    type: "GET",
    contentType: 'application/json',
    data: {bbh: bbh,fbrq:fbrq},
    url: "dataSet/publishDataSet",
    success: function (jsonData) {
        if (jsonData.code == 200) {
            if (jsonData.res == "1") {
                LayerWn.showSucAlert("发布成功");
                for (var k = 0; k < parent.frames.length; k++) {
                    if (parent.frames[k].frameElement.src.indexOf("psms-sjjgl.html") != -1)
                        parent.frames[k].searchTree();
                }
                setTimeout(function () {
                    parent.layer.closeAll()
                }, 2000);
            }else if (jsonData.res == "-1") {
                LayerWn.showSucAlert('版本已存在！');
            }
        }else {
            LayerWn.showFailAlert('服务器异常,请联系管理员');
        }
    }
 });
}

